﻿using System;
using System.Runtime.Serialization;

namespace GEPL.InterfaceLibrary
{
    /// <summary>
    /// The interface that must be implemented by all programming blocks (user controls).
    /// All elements must be also serializable and deserializable (must implement ISerializable and a deserialization constructor).
    /// </summary>
    public interface IElement : ISerializable
    {
        /// <summary>
        /// Defines the type of this programming element (NormalStatement / StartBlock / MiddleBlock / EndBlock).
        /// </summary>
        ElementType ElementType { get; }

        /// <summary>
        /// Type of project that can use this element (console / turtle graphics / any)
        /// </summary>
        ProjectType ProjectType { get; }

        /// <summary>
        /// Name of this programming block - should be taken from localized resources.
        /// Displayed in element header and in toolbox.
        /// </summary>
        string ElementName { get; }

        /// <summary>
        /// Element's data.
        /// It will be used as DataContext for a user control.
        /// </summary>
        object Data { get; }

        /// <summary>
        /// The System.Type of the User Control that should be displayed when this element is used.
        /// </summary>
        Type UserControlType { get; }

        /// <summary>
        /// Python script that should be executed.
        /// </summary>
        string GetScript();
    }
}